//
//  MapViewToolsView.m
//  SDK开发版本
//
//  Created by 北京国泰北斗科技有限公司 on 16/10/19.
//  Copyright © 2016年 北京国泰北斗科技有限公司. All rights reserved.
//

#import "MapViewToolsView.h"
#import "Public.h"

@interface MapViewToolsView()

@property(nonatomic,strong)MapViewToolsView *toolView;
@end

@implementation MapViewToolsView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIImageView *imageView = [[UIImageView alloc] initWithImage:MYBUNDLE_IMAGE_PATH(@"网络异常提示")];
        imageView.userInteractionEnabled = YES;
        imageView.frame = self.bounds;
        imageView.contentMode = UIViewContentModeScaleAspectFit;
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(imageView.bounds.size.width-40, 0, 40, 43);
        button.backgroundColor = [UIColor clearColor];
        [button addTarget:self action:@selector(hiddenView) forControlEvents:UIControlEventTouchUpInside];
        [imageView addSubview:button];
        
        self.alpha = 0.0f;
        [self addSubview:imageView];
    }
    return self;
}

- (void)showNoNetwork{

    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 1.0f;
    }];
}

- (void)hiddenNoNetwork{
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0.0f;
    }];
}

- (void)hiddenView{
    [self hiddenNoNetwork];
}
@end
